package com.codechuan.demo.ui.dashboard;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import com.codechuan.demo.common.Constant;
import com.codechuan.demo.databinding.FragmentDashboardBinding;
import com.codechuan.demo.ui.myOrder.MyOrder;

/**
 * @Deprecated 订单列表视图
 */
public class DashboardFragment extends Fragment implements View.OnClickListener {

    private FragmentDashboardBinding binding;

    public View onCreateView(@NonNull LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {

        binding = FragmentDashboardBinding.inflate(inflater, container, false);
        Button queryApp = binding.queryApp;
        queryApp.setOnClickListener(this);
//        Button queryMini = binding.queryMini;
//        queryMini.setOnClickListener(this);
        return  binding.getRoot();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        binding = null;
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (binding.queryApp.getId() == id){
            Constant.QUERY_ORDER_TYPE = "APP";
            Intent intent = new Intent();
            intent.setClass(Constant.context , MyOrder.class);
            startActivity(intent);
        }
//        if (binding.queryMini.getId() == id){
//            Constant.QUERY_ORDER_TYPE = "XCX";
//            Intent intent = new Intent();
//            intent.setClass(Constant.context , MyOrder.class);
//            startActivity(intent);
//        }
    }
}